<template>
  <div class="department" id="department">
    <!-- 左侧部门管理 -->
    <div class="structureTree" v-if="treelength">
      <div class="structureTree_title">
        <div>组织机构</div>
        <div>
          <!-- <el-checkbox v-model="checked" @change="see()">查看下级</el-checkbox> -->
        </div>
      </div>
      <tree
        :treeData="treeData"
        :checkData="checkData"
        nodeKey="fCompanyid"
        @getTreeInfo="handleNodeClick"
        :defaultProps="defaultProps"
      >
      </tree>
    </div>
    <!-- 右侧 -->
    <div class="department_right">
      <!-- 机构名称 -->
      <el-breadcrumb :title="showName"></el-breadcrumb>
      <!-- 顶部导航栏 -->
      <div class="mechanism_nav" v-show="typeData[0].show"></div>
      <div class="mechanism_nav" v-show="!typeData[0].show">
        <!-- 左侧 -->
        <div class="mechanism_nav_left" style="width: 100%">
          <input
            type="text"
            placeholder="姓名"
            v-model="getList.keyWord"
            v-if="typeData[1].show"
          />
          <el-button
            type="primary"
            icon="el-icon-search"
            size="small"
            @click="getTableList(1)"
            v-if="typeData[1].show"
            >查询</el-button
          >

          <input
            type="text"
            placeholder="设备名称/设备编号"
            v-model="getList.keyWord"
            v-if="typeData[2].show"
          />
          <el-button
            type="primary"
            icon="el-icon-search"
            size="small"
            @click="getTableList(2)"
            v-if="typeData[2].show"
            >查询
          </el-button>
        </div>
        <!-- 顶部按钮 -->
        <div class="print">
          <div class="printTable">
            <el-button
              type="primary"
              icon="el-icon-refresh"
              size="small"
              @change="Refresh(getList)"
            >
            </el-button>
            <el-button
              type="primary"
              v-if="yj_view"
              icon="el-icon-search"
              size="small"
              @click="editText()"
            >
              查看
            </el-button>
            <el-button
              type="primary"
              v-if="yj_export"
              icon="el-icon-search"
              size="small"
              @click="Print()"
            >
              导出
            </el-button>
          </div>
        </div>
      </div>
      <!-- 表格 -->
      <div class="text_table">
        <div class="dialogBodyBox">
          <div class="tab">
            <div
              v-for="(data, index) in typeData"
              :key="data.value"
              @click="changeType($event, index)"
            >
              <div
                class="btn"
                :style="{
                  color:
                    data.show === true ? 'rgba(0, 117, 255, 1)' : '#343639',
                  background: data.show === true ? '#E0EFFF' : '#fff',
                }"
              >
                {{ data.text }}
              </div>
            </div>
          </div>

          <div class="charts textareaFrom" v-if="typeData[0].show">
            <div style="height: 20px"></div>
            <div
              class="publicForm ListPublicForm"
              style="height: calc(100% - 20px)"
            >
              <publicForm
                ref="publicForm"
                lableWidth="160px"
                :formObj="FromShow"
                :formData="formData"
                :timestamp="formData.fFile"
                :fileList="fSourcefileList"
              >
              </publicForm>
            </div>
          </div>
          <div class="charts" v-if="typeData[1].show">
            <tableData
              :height="navigatepageNums > 1 ? 'calc(100% - 50px)' : '100%'"
              :config="table_noe"
              :dataList="tableData"
              :loading="loading"
              @click-change="rowChange"
              @ClickOnLine="yj_viewForm"
              :page="getList.page"
              :pageSize="getList.pageSize"
            />
            <pagination
              v-if="navigatepageNums > 1"
              :info="queryCriteriaData"
              :treelength="treelength"
              :total="queryCriteriaData.total"
              :pageNum.sync="getList.page"
              :limit.sync="getList.pageSize"
              @pagination="getTesterForm(getList)"
            />
          </div>
          <div class="charts" v-if="typeData[2].show">
            <tableData
              :height="navigatepageNums1 > 1 ? 'calc(100% - 50px)' : '100%'"
              :config="table_tow"
              :dataList="tableData"
              :loading="loading"
              @selection-change="selectionChange"
              @sort-change="sortChange"
              @click-change="rowChange1"
              @ClickOnLine="yj_viewForm1"
              :page="getList.page"
              :pageSize="getList.pageSize"
            />
            <pagination
              v-if="navigatepageNums1 > 1"
              :info="queryCriteriaData1"
              :treelength="treelength"
              :total="queryCriteriaData1.total"
              :pageNum.sync="getList.page"
              :limit.sync="getList.pageSize"
              @pagination="getLabEquipForm(getList)"
            />
          </div>
        </div>
      </div>

      <!--详情-->
      <div class="Control-1 mechanism_dialogS closure">
        <el-dialog
          :title="dialogTitle"
          :modal-append-to-body="false"
          v-dialogDrag
          :visible.sync="dialogEditVisible"
          v-loading="loadingEditDialog"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div
            class="dialogBody common"
            :style="{ height: '650px' }"
            style="overflow: hidden"
          >
            <div style="overflow-y: auto; height: 100%; margin-bottom: 20px">
              <div class="publicForm" style="height: 100%">
                <publicForm
                  ref="publicForm0"
                  lableWidth="100px"
                  :formObj="detailsFrom"
                  :formData="detailsFromData"
                >
                </publicForm>
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

 <script src="./index.js"></script>

<style scoped lang="less">
@import "./index.less";
</style>